package demo;

public class Demo2 {
    public static void main(String[] args) {
        Circle circle = new Circle(5);
        circle.showArea(5);
        circle.showPerimeter(5);
    }
}
 class Circle{
    double r;
    public  Circle(double r){
         this.r=r;
    }
    void  showArea(double r){
        double s=Math.PI*Math.pow(r,2);
        System.out.println("该圆的面积为：" + s);
    }
    void showPerimeter(double r){
        double c=2*Math.PI*r;
        System.out.println("该圆的周长为：" + c);
    }



}
